﻿namespace demo.Interfaces
{
    public interface IRepository<T> where T : class
    {
        IQueryable<T> GetAll();//为了实现在数据库分页，新加的接口
        Task<List<T>> GetAllAsync();
        Task<int> GetAllCountAsync();
        Task<T> GetByIdAsync(int id);
        Task AddAsync(T entity);
        Task UpdateAsync(T entity);
        Task DeleteAsync(T entity);

        Task<int> CountAsync();
    }
}
